package edu.ubb.scp.model;

import java.lang.reflect.Field;

public class Customer implements Model {
	private int CustomerID;
	private String CustomerName;
	private float CustomerTab;

	public Customer(String customerName, float customerTab) {
		super();
		CustomerName = customerName;
		CustomerTab = customerTab;
	}

	public Customer() {

	}

	public int getCustomerID() {
		return CustomerID;
	}

	public void setCustomerID(int customerID) {
		CustomerID = customerID;
	}

	public String getCustomerName() {
		return CustomerName;
	}

	public void setCustomerName(String customerName) {
		CustomerName = customerName;
	}

	public float getCustomerTab() {
		return CustomerTab;
	}

	public void setCustomerTab(float customerTab) {
		CustomerTab = customerTab;
	}

	@Override
	public String toString() {
		return "Customer [CustomerID=" + CustomerID + ", CustomerName="
				+ CustomerName + ", CustomerTab=" + CustomerTab + "]";
	}
	
	@Override
	public Field getPrimaryKey() {
		try {
			return Customer.class.getDeclaredField("CustomerID");
		} catch (NoSuchFieldException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	@Override
	public Field[] getKeys() {
		return new Field[] { getPrimaryKey() };
	}
}
